use serde_json::Value;
use simd_json::serde;

fn t1() -> Result<(), simd_json::Error> {
    let mut json_str = r#"{
        "name": "Bob",
        "active": true,
        "scores": [85, 92, 78],
        "mymap":{
            "a":1,
            "l":[2,5,9]
        }
    }"#.as_bytes().to_vec();
    
    // 使用serde_json解析JSON
    let v: Value =serde::from_slice(&mut json_str)? ;
    
    println!("Name: {}", v["name"]);
    println!("First score: {}", v["scores"][0]);
    println!("mymap.a: {}", v["mymap"]["l"][1]);
    
    Ok(())
}

#[test]
fn test_t1() -> Result<(), simd_json::Error> {
    t1()
}